package TestCode;

class  Student{
    private int age;

    //    有参构造方法
    public Student(int age){
        this.age = age;
    }

    public void show(){
        System.out.println("年龄：" + age);
    }
}


/**
* @author GZQ
* @Date 2023/12/28
 */
public class Test02{
    public static void main(String[] args) {
        Student student = new Student(23);
        student.show(); // 打印姓名和年龄
    }
}

